package cn.tedu._03vehicle.controller;

import cn.tedu._03vehicle.base.response.JsonResult;
import cn.tedu._03vehicle.mapper.NoticeMapper;
import cn.tedu._03vehicle.pojo.vo.NoticeListVo;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;
import java.util.List;

@Slf4j
@RestController
@Tag(name = "公告相关接口")
@RequestMapping("v1/notice")
public class NoticeController {
    @Autowired
    private NoticeMapper noticeMapper;

    @Autowired
    private RedisTemplate<String, Serializable> redisTemplate;

    @GetMapping("list")
    @Operation(summary = "获取公告列表")
    @ApiOperationSupport(order = 10)
    public JsonResult list() {
        List<NoticeListVo> list = noticeMapper.list();
        return JsonResult.ok(list);
    }
}
